<div class="add_app_box">
    <form class="layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label">名称</label>
            <div class="layui-input-block">
            <input type="text" name="name"  placeholder="应用名称*" autocomplete="off" class="layui-input" lay-verify="required" lay-verType="tips">
            </div>
        </div>
        
        <div class="layui-form-item">
            <label class="layui-form-label">昵称</label>
            <div class="layui-input-block">
            <input type="text" name="nick" placeholder="应用昵称" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">图标</label>
            <div class="layui-input-block">
            <input type="text" name="logo" placeholder="填写图片地址" autocomplete="off" class="layui-input" >
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">链接</label>
            <div class="layui-input-block">
            <input type="text" name="link" placeholder="https://" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
            <textarea placeholder="..." name="description" class="layui-textarea"></textarea>
            </div>
        </div>

        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
            <textarea placeholder="..." name="remark" class="layui-textarea"></textarea>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="add_app">立即提交</button>
            </div>
        </div>
    <!-- 更多表单结构排版请移步文档左侧【页面元素-表单】一项阅览 -->
    </form>
</div>

<script>
    form.render()
    form.on('submit(add_app)', d => {
        _post('/index/api/add', d.field, c => {
            if(c && c.code == 1) {
                _tip('添加成功', 6)
                setTimeout(() => {
                    location.reload()
                }, 1000)
            } else {
                _tip('添加失败', 5)
            }
        })
        return false
    })
</script>